//
//  LFFamousTableViewCell.m
//  LocalLife
//
//  Created by 李立达 on 15/11/25.
//  Copyright © 2015年 heima11. All rights reserved.
//

#import "LFFamousTableViewCell.h"
#import "LFFamousCollectionViewCell.h"
static NSString *cellID=@"LFFamousCollectionViewCell";
@interface LFFamousTableViewCell ()<UICollectionViewDelegate,UICollectionViewDataSource>
@property (weak, nonatomic) IBOutlet UICollectionView *FamousCollection;

@property (weak, nonatomic) IBOutlet UICollectionViewFlowLayout *Famouslayout;

@end
@implementation LFFamousTableViewCell

-(id)init
{
    self=[[NSBundle mainBundle]loadNibNamed:@"LFFamousTableViewCell" owner:nil options:nil].lastObject;
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _Famouslayout.itemSize=CGSizeMake(KscreedWdith/2,(200.0/2.0) );
    _Famouslayout.minimumLineSpacing=0;
    _Famouslayout.minimumInteritemSpacing=0;
    _Famouslayout.sectionInset=UIEdgeInsetsZero;
}
- (void)awakeFromNib {
    // Initialization code
    [_FamousCollection registerNib:[UINib nibWithNibName: @"LFFamousCollectionViewCell"bundle:nil] forCellWithReuseIdentifier:cellID];
    _FamousCollection.showsVerticalScrollIndicator=NO;
    _FamousCollection.showsHorizontalScrollIndicator=NO;
    _FamousCollection.backgroundColor=[UIColor whiteColor];
    _FamousCollection.scrollEnabled=NO;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return self.list.list.count;
}

// The cell that is returned must be retrieved from a call to -dequeueReusableCellWithReuseIdentifier:forIndexPath:
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    LFFamousCollectionViewCell *cell=[collectionView dequeueReusableCellWithReuseIdentifier:cellID forIndexPath:indexPath];
    cell.model=self.list.list[indexPath.row];
    return cell;
}
@end
